﻿@using CoreData
@model List<ShoppingCart>
@{
    var toTalProduct = 0;
    if (Model != null)
    {
        foreach (var item in Model)
        {
            toTalProduct = toTalProduct + item.Amount;
        }
    }
    ViewBag.Title = String.Format("Giỏ hàng ({0})", toTalProduct);
    Layout = "~/Views/Shared/_Layout.cshtml";
}
@section HeadResource{
    <title>@ViewBag.Title</title>
    <link href="@Url.Content("~/Content/css/shoppingcart.css")" rel="stylesheet" type="text/css" />
}
@section BottomResource{
    <script src="@Url.Content("~/Content/js/shoppingcart.js")" type="text/javascript"></script>
}
<div class="main-content">
    <div class="cart-grid grid-view">
        <div class="breadcrumbs">
            <ul>
                <li><a href="#">Trang chủ</a> <span class="crumb">/</span> </li>
                <li><span>Giỏ hàng</span> </li>
            </ul>
        </div>
        <div class="product-title">
            <h1>
                Giỏ hàng</h1>
        </div>
        <div class="cart-view">
            @Html.Action("_ListCart", "ShoppingCart")
        </div>
    </div>
    @if (Model != null && Model.Count > 0)
    {
        @Html.Action("_RelatedProduct", "Product", new { @Id = Model.First().Product.CateID })
    }
    else
    { 
        @Html.Action("_RelatedProduct", "Product", new { @Id = 0 })
    }
</div>
